<?php
/*
 * @Date: 2025-10-02 14:33:33
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-10-02 15:01:53
 * @FilePath: /admin-api/database/migrations/2025_10_02_063333_create_uploads_table.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('uploads', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('文件名');
            $table->string('status')->default('finished')->comment('上传的状态');
            $table->string('type')->comment('MIME 类型');
            $table->string('path')->comment('上传文件的相对路径');
            $table->string('size')->comment('文件大小');
            $table->string('url')->comment('文件的 URL');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('uploads');
    }
};
